//
//  test.hpp
//  Cpp_Demo
//
//  Created by Robin Guo on 2017/9/23.
//  Copyright © 2017年 Robin Guo. All rights reserved.
//

#ifndef test_hpp
#define test_hpp

#include <stdio.h>
#include <iostream>

using namespace std;

class TestOp {
    int i;
    float y;
    char ch;
    
public:
    TestOp(){};
    TestOp(int a,float b,char c) { i=a,y=b,c=ch; }
    bool operator==(TestOp &);
    
    friend ostream& operator<<(ostream &,TestOp &);
    friend istream& operator>>(istream &,TestOp &);
};

ostream& operator<<(ostream &os,TestOp &obj) {
    os << obj.i << ",";
    os << obj.y << ",";
    os << obj.ch << endl;
    return os;
}

istream& operator>>(istream &is,TestOp &obj) {
    is >> obj.i;
    is >> obj.y;
    is >> obj.ch;
    return is;
}

bool TestOp::operator==(TestOp &op) {
    if (this->i == op.i && this->y == op.y && this->ch == op.ch) {
        return true;
    }
    return false;
    
}

#endif /* test_hpp */
